package com.topscomm.mpm.xxlJob;

import com.topscomm.mpm.service.IMpmProjectSuperviseService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author wudaliang
 * @date 2021/7/30
 * @description:  检查更新督办状态，超过3天的置为超期
 * @modify:
 */
@JobHandler(value = "projectSuperviseCheckJob")
@Component
public class ProjectSuperviseCheckJob extends IJobHandler {

    @Autowired
    private IMpmProjectSuperviseService mpmProjectSuperviseService;

    @Override
    public ReturnT<String> execute(String param) {
        try {
            this.mpmProjectSuperviseService.ProjectSuperviseCheckJob();
            return ReturnT.SUCCESS;
        } catch (Exception e) {
            return new ReturnT<>(ReturnT.FAIL_CODE, e.getMessage());
        }
    }
}
